class Example{



    static void main(String[] args){
         def dir = new File("D:\\Document")

        dir.eachFile{file ->
            println file
        }

        println("list the root of tmp:")
        def rootFiles = new File("tmp").listRoots()
        rootFiles.each {
            file-> println file.absolutePath
        }

        println("list eachFile of the tmp:")
        new File("D:/temp").eachFile{
            file -> println file
        }
        println("list eachFile absolutePath of the tmp:")
        new File("D:/temp").eachFile{
            file -> println file.getAbsolutePath()
        }
    }
}